package com.servlet.ihm;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.listener.ContextListener;
import com.servlet.model.base.Profile;

public class ProfilPersoServlet extends HttpServlet
{
	public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
	{
		HttpSession session = request.getSession();

		String email = (String)session.getAttribute("email");

		Profile profile = ContextListener.base.findProfile(email);
		
		request.setAttribute("profile", profile );
		
		request.setAttribute("page", new String("profil"));
		//rubrique dans la page
		request.setAttribute("rubrique", new String("Perso"));
		RequestDispatcher dispatch = request
				.getRequestDispatcher("jsp/pageBase.jsp");
		dispatch.forward(request, response);
	}
}
